package com.itheima.manager.Util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class AgeUtil {

    public AgeUtil() {
    }

    public static String getAge(String birthday){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        try{
            Date date = sdf.parse(birthday);
            Date date1 = new Date();
            long time = (date1.getTime() - date.getTime()) /(356 * 24 * 3600 *1000L);
            return time + "";
        }catch (Exception e){
            return  "-1";
        }

    }
}
